package com.tanhua.controller;

import com.tanhua.service.AnalysisByDayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping(value = "/dashboard")
public class DashboardController {

    @Autowired
    private AnalysisByDayService analysisByDayService;

    //统计摘要
    @GetMapping("/summary")
    public ResponseEntity summary() {
        return analysisByDayService.summary();
    }

    //新增、活跃用户、次日留存率
    @GetMapping("/users")
    public ResponseEntity users(String sd ,String ed ,String type) {

        ResponseEntity map = analysisByDayService.users(sd, ed, type);

        System.out.println("YearVO:"+map);
        return ResponseEntity.ok(map);
    }

}
